package com.demo.user.xml.service;

import com.demo.user.xml.dao.UserDAO;

public class UserServiceImpl implements UserService {
	
	public UserServiceImpl() {
		System.out.println("service-instance");
	}
	
	// private UserDAO userDAO = new UserDAOImpl();
	
	private UserDAO userDAO;
	
	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	public UserServiceImpl(UserDAO userDao) {
		System.out.println("service-instance");
		this.userDAO = userDao;
	}
	
	/* (non-Javadoc)
	 * @see com.demo.user.service.UserService#saveUser()
	 */
	@Override
	public void saveUser() {
		userDAO.addUser();
	}
}
